#include<stdio.h>
int main()
{
	int n,a[1000],i,k=1,cha;
	int mid,min=0,max;
	scanf("%d",&n);
	max=n;
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&cha);
	
	while(min+1!=max)
		{
			mid=(max+min)/2;
			if(a[mid]<cha)
				{
					min=mid;
					k++;
					continue;
				}
			if(a[mid]>cha)
				{
					max=mid;
					k++;
					continue;
				}
			if(a[mid]=cha)
				{
					printf("YES %d\n",k);
					break;
				}
		}
	if(min+1==max)
		printf("NO %d\n",k-1);
		return 0;
}
